/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package client;

/**
 *
 * @author juan
 */
public class Response {
    public Response(String msg) {
        int pos = msg.indexOf(" ");
        this.code = Integer.parseInt(msg.substring(0,pos));
        this.msg = msg.substring(pos+1);
    }
    @Override
    public String toString() {
        return code+" "+msg;
    }

    public void succeded() {
        succeded = true;
    }
    public void failed() {
        succeded = false;
    }
    public boolean hasFailed() {
        return !succeded;
    }
    String msg;
    int code;
    boolean succeded;
}
